<?php $this->renderPartial('/_include/_content_menu');?>
<script type="text/javascript">
    $(document).ready(function() {
        $('input.small-text').keyup(function() {
            if($(this).val().length > 4 || isNaN($(this).val()))
               $(this).val(1);
        });
    });
</script>
<div class="main">
    <div class="body">
        <ul class="breadcrumb">
            <li><a href="<?php echo $this->createUrl('default/index')?>">首页</a> <span class="divider">/</span></li>
            <li>导航列表</a> </li>
        </ul>
        <p class="oper"><a href="<?php echo $this->createUrl('nav/create');?>" class="btn btn-info">添加</a></p>
            <table class="table table-striped">
                <form method="post">
                <tr>
                    <th>导航名称</th>
                    <th>导航排序</th>
                    <th>是否激活</th>
                    <th>操作</th>
                </tr>
                <?php foreach($data as $key=>$value):?>
                    <tr>
                        <td><?php echo $value->nav_name;?></td>
                        <td><input type="hidden" name="ids[]" value="<?php echo $value->id;?>"><input type="text" name="sortNum[]" class="small-text" value="<?php echo $value->nav_sort;?>"></td>
                        <td><?php echo $value->nav_is_active == 1 ? '是' : '否';?></td>
                        <td>
                            <a href="<?php echo $this->createUrl('nav/update', array('id'=>$value->id));?>" class="btn"><i class="icon-edit"></i></a>
                            <a onclick="return confirm('确认删除？') ? true : false;" href="<?php echo $this->createUrl('nav/delete', array('id'=>$value->id))?>" class="btn"><i class="icon-remove"></i></a>
                        </td>
                    </tr>
                <?php endforeach?>
                <tr><td></td><td><input type="submit" name="send" class="btn btn-primary" value="一键排序"/></td><td></td><td></td></tr>
                </form>
            </table>
        <div class="yii-pager">
            <?php $this->widget('BLinkPager',
                array(
                    'pages'=>$pager,
                    'prevPageLabel'=>'上一页',
                    'nextPageLabel'=>'下一页',
                    'header'=>''
                ));?>
        </div>
    </div>
</div>
